package com.julinggame.nettyim;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.awt.*;

@Getter
@AllArgsConstructor
public enum CommentType {
    /**
     * 链接
     */
    CONNECT(100001),
    /**
     * 聊天
     */
    CHAT(100000),
    ERROR(100002);
    private final Integer code;

    public static CommentType match(Integer code) {
        for (CommentType commentType : CommentType.values()) {
            if (commentType.getCode().equals(code)) {
                return commentType;
            }
        }
        return ERROR;
    }
}
